home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / var / lib / dpkg / info / onboard.prerm < prev    next >
Encoding:
Text File  |  2008-03-03  |  1.9 KB  |  79 lines

  1. #!/bin/sh
  2. set -e
  3. # Automatically added by dh_pycentral
  4. if [ "$1" = remove ]; then
  5. if which python >/dev/null 2>&1 && which pycentral >/dev/null 2>&1; then
  6.     pycentral pkgremove onboard
  7. else
  8.     flist=$(tempfile)
  9.     slist=$(tempfile)
  10.     dpkg -L onboard | tee $flist | \
  11.     while read n; do
  12.       case "$n" in
  13.         /usr/share/pyshared/*)
  14.           n2=${n#/usr/share/pyshared/*}
  15.           case "$n" in
  16.         *.py) echo "p $n";;
  17.         *) [ -d "$n" ] && echo "d $n2" || echo "f $n2"
  18.           esac
  19.           ;;
  20.         *) continue
  21.       esac
  22.     done > $slist
  23.     if [ -s $slist ]; then
  24.         for d in /usr/lib/python[0-9].[0-9]/????-packages; do
  25.         case "$d" in */python2.1/*|*/python2.2/*) continue; esac
  26.         while read t n; do
  27.             case "$t" in
  28.             p) rm -f $d/$n $d/${n}[co];;
  29.             d) rmdir $d/$n 2>/dev/null || true;;
  30.             *) rm -f $d/$n
  31.             esac
  32.         done < $slist
  33.         done
  34.     fi
  35.         awk '/\/usr\/share\/pyshared/ {next} /\.py$/ {print $0"c\n" $0"o"}' $flist \
  36.         | xargs -r rm -f >&2
  37.     rm -f $flist $slist
  38. fi
  39. fi
  40. # End automatically added section
  41. # Automatically added by dh_pycentral
  42. if [ "$1" = remove ]; then
  43. if which python >/dev/null 2>&1 && which pycentral >/dev/null 2>&1; then
  44.     pycentral pkgremove onboard
  45. else
  46.     flist=$(tempfile)
  47.     slist=$(tempfile)
  48.     dpkg -L onboard | tee $flist | \
  49.     while read n; do
  50.       case "$n" in
  51.         /usr/share/pyshared/*)
  52.           n2=${n#/usr/share/pyshared/*}
  53.           case "$n" in
  54.         *.py) echo "p $n";;
  55.         *) [ -d "$n" ] && echo "d $n2" || echo "f $n2"
  56.           esac
  57.           ;;
  58.         *) continue
  59.       esac
  60.     done > $slist
  61.     if [ -s $slist ]; then
  62.         for d in /usr/lib/python[0-9].[0-9]/????-packages; do
  63.         case "$d" in */python2.1/*|*/python2.2/*) continue; esac
  64.         while read t n; do
  65.             case "$t" in
  66.             p) rm -f $d/$n $d/${n}[co];;
  67.             d) rmdir $d/$n 2>/dev/null || true;;
  68.             *) rm -f $d/$n
  69.             esac
  70.         done < $slist
  71.         done
  72.     fi
  73.         awk '/\/usr\/share\/pyshared/ {next} /\.py$/ {print $0"c\n" $0"o"}' $flist \
  74.         | xargs -r rm -f >&2
  75.     rm -f $flist $slist
  76. fi
  77. fi
  78. # End automatically added section
  79.